From 1804feedcb4af26d910348fcb6ba4569df57493d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Steinbrink?= Date: Tue, 26 Aug 2014 20:55:39 +0200 Subject: [PATCH] Fix building with current rust --- Cargo.lock | 26 +++++++++++++------------- src/cargo/sources/git/source.rs | 3 ++- src/cargo/util/to_url.rs | 4 ++-- tests/test_cargo_compile.rs | 2 +- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f38573f0d..6b02ba227 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,31 +2,31 @@ name = "cargo" version = "0.0.1-pre" dependencies = [ - "docopt 0.6.0 (git+https://github.com/burntsushi/docopt.rs#fd2377d1c36b2671136cd36566aad5d54c2fb17e)", - "docopt_macros 0.6.0 (git+https://github.com/burntsushi/docopt.rs#fd2377d1c36b2671136cd36566aad5d54c2fb17e)", + "docopt 0.6.0 (git+https://github.com/burntsushi/docopt.rs#fc7ba2f1a5a351f7874257d880223d2ff5c75d36)", + "docopt_macros 0.6.0 (git+https://github.com/burntsushi/docopt.rs#fc7ba2f1a5a351f7874257d880223d2ff5c75d36)", "hamcrest 0.1.0 (git+https://github.com/carllerche/hamcrest-rust.git#f0fd1546b0a7a278a12658ab8602b5c827cc3a42)", - "semver 0.0.1 (git+https://github.com/rust-lang/semver#e17191f51d543529a6f07e6731802b77977fcef8)", - "toml 0.1.0 (git+https://github.com/alexcrichton/toml-rs#e7c7bba846fea549fe4e93de4c9d21e851a9882f)", - "url 0.1.0 (git+https://github.com/servo/rust-url#678bb4d52638b1cfdab78ef8e521566c9240fb1a)", + "semver 0.0.1 (git+https://github.com/rust-lang/semver#c78b40d7fdf8acd99b503e6ce394fbcf9eb8982f)", + "toml 0.1.0 (git+https://github.com/alexcrichton/toml-rs#8c128cb550ba66d4962cd81acca93857c605eaa0)", + "url 0.1.0 (git+https://github.com/servo/rust-url#23fb9ec22cca9d643ad2cce9894a947c005b7fe2)", ] [[package]] name = "docopt" version = "0.6.0" -source = "git+https://github.com/burntsushi/docopt.rs#fd2377d1c36b2671136cd36566aad5d54c2fb17e" +source = "git+https://github.com/burntsushi/docopt.rs#fc7ba2f1a5a351f7874257d880223d2ff5c75d36" [[package]] name = "docopt_macros" version = "0.6.0" -source = "git+https://github.com/burntsushi/docopt.rs#fd2377d1c36b2671136cd36566aad5d54c2fb17e" +source = "git+https://github.com/burntsushi/docopt.rs#fc7ba2f1a5a351f7874257d880223d2ff5c75d36" dependencies = [ - "docopt 0.6.0 (git+https://github.com/burntsushi/docopt.rs#fd2377d1c36b2671136cd36566aad5d54c2fb17e)", + "docopt 0.6.0 (git+https://github.com/burntsushi/docopt.rs#fc7ba2f1a5a351f7874257d880223d2ff5c75d36)", ] [[package]] name = "encoding" version = "0.1.0" -source = "git+https://github.com/lifthrasiir/rust-encoding#b82ad2104b2d079620bd227fb9328b2ff8c20ca9" +source = "git+https://github.com/lifthrasiir/rust-encoding#7e7950ddbd46428a439db3e2594fa78f0972ef2e" [[package]] name = "hamcrest" @@ -36,18 +36,18 @@ source = "git+https://github.com/carllerche/hamcrest-rust.git#f0fd1546b0a7a278a1 [[package]] name = "semver" version = "0.0.1" -source = "git+https://github.com/rust-lang/semver#e17191f51d543529a6f07e6731802b77977fcef8" +source = "git+https://github.com/rust-lang/semver#c78b40d7fdf8acd99b503e6ce394fbcf9eb8982f" [[package]] name = "toml" version = "0.1.0" -source = "git+https://github.com/alexcrichton/toml-rs#e7c7bba846fea549fe4e93de4c9d21e851a9882f" +source = "git+https://github.com/alexcrichton/toml-rs#8c128cb550ba66d4962cd81acca93857c605eaa0" [[package]] name = "url" version = "0.1.0" -source = "git+https://github.com/servo/rust-url#678bb4d52638b1cfdab78ef8e521566c9240fb1a" +source = "git+https://github.com/servo/rust-url#23fb9ec22cca9d643ad2cce9894a947c005b7fe2" dependencies = [ - "encoding 0.1.0 (git+https://github.com/lifthrasiir/rust-encoding#b82ad2104b2d079620bd227fb9328b2ff8c20ca9)", + "encoding 0.1.0 (git+https://github.com/lifthrasiir/rust-encoding#7e7950ddbd46428a439db3e2594fa78f0972ef2e)", ] diff --git a/src/cargo/sources/git/source.rs b/src/cargo/sources/git/source.rs index 4d589d62c..906f5140e 100644 --- a/src/cargo/sources/git/source.rs +++ b/src/cargo/sources/git/source.rs @@ -106,7 +106,8 @@ pub fn canonicalize_url(url: &Url) -> Url { url.scheme = "https".to_string(); match url.scheme_data { url::RelativeSchemeData(ref mut rel) => { - rel.port = "443".to_string(); + rel.port = Some(443); + rel.default_port = Some(443); let path = mem::replace(&mut rel.path, Vec::new()); rel.path = path.move_iter().map(|s| { s.as_slice().chars().map(|c| c.to_lowercase()).collect() diff --git a/src/cargo/util/to_url.rs b/src/cargo/util/to_url.rs index 93df2b30c..c99ba4d27 100644 --- a/src/cargo/util/to_url.rs +++ b/src/cargo/util/to_url.rs @@ -26,8 +26,8 @@ impl<'a> ToUrl for &'a str { fn mapper(s: &str) -> url::SchemeType { match s { - "git" => url::RelativeScheme("9418"), - "ssh" => url::RelativeScheme("22"), + "git" => url::RelativeScheme(9418), + "ssh" => url::RelativeScheme(22), s => url::whatwg_scheme_type_mapper(s), } } diff --git a/tests/test_cargo_compile.rs b/tests/test_cargo_compile.rs index 7bf37e965..e3f7f79ee 100644 --- a/tests/test_cargo_compile.rs +++ b/tests/test_cargo_compile.rs @@ -100,7 +100,7 @@ test!(cargo_compile_with_invalid_code { execs() .with_status(101) .with_stderr(format!("\ -{filename}:1:1: 1:8 error: expected item but found `invalid` +{filename}:1:1: 1:8 error: expected item, found `invalid` {filename}:1 invalid rust code! ^~~~~~~ Could not compile `foo`. -- 2.30.2